package elven.codingit.easyutil.annotation;

import java.lang.reflect.Field;

import com.alibaba.fastjson.annotation.JSONField;

public class EasyUtilTarget {

	@JSONField(name="keys")
	private String name;

	public String getAnnotationValue() throws Exception{
		Field[] ds =  EasyUtilTarget.class.getDeclaredFields();
		for(Field temp : ds){
			if(temp.getName().equals("name")){
				temp.setAccessible(true);
				return temp.getAnnotation(JSONField.class).name();
			}
		}
		return null;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public static void main(String[] args) {
		try {
			EasyUtilTarget target = new EasyUtilTarget();
			System.out.println(target.getAnnotationValue());
			System.out.println(target.getName());
		} catch (Exception e) {
			e.printStackTrace();
		}	
	}
}